<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTableGoodsSkuStock extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods_sku_stock', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('sku_id')->comment('货品ID');
            $table->bigInteger('goods_id')->comment('产品ID');
            $table->integer('quantity')->default(0)->comment('库存');
            $table->tinyInteger('status')->default(1)->comment('状态 1:enable, 0:disable, -1:deleted');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods_sku_stock');
    }
}
